﻿/*
 * Created by SharpDevelop.
 * User: ratul
 * Date: 3/4/2010
 * Time: 8:00 PM
 * 
 * To change this template use Tools | Options | Coding | Edit Standard Headers.
 */

using System;

namespace H264Impl.NET
{
	/// <summary>
	/// Description of Utility.
	/// </summary>
	public static class Utility
	{
//		public Utility()
//		{
//		}
		
		public static UInt32 InverseRasterScan( UInt32 macroblockAddress, UInt32 macroblockWidth, UInt32 macroblockHeight, UInt32 pictureWidthinSamples, bool heightRequired )
		{
			if(heightRequired==false)
				return (macroblockAddress%(pictureWidthinSamples/macroblockWidth))*macroblockWidth; //width
			else
				return (macroblockAddress/(pictureWidthinSamples/macroblockWidth))*macroblockHeight; //height
			
		}
	}
}
